﻿@inject NavigationManager NavigationManager



    @if (Model.State == EditState.None)
    {
    <MButton Text Block Color="primary" OnClick="OnNav">
            <MIcon Left>mdi-plus</MIcon>
            @("添加"+Model.Title)
        </MButton>
    }
    else if (Model.State == EditState.Normal)
    {
    <MButton Text Block Color="primary" OnClick="OnNav">
            <MIcon Left>mdi-pencil</MIcon>
            @("编辑"+Model.Title)
        </MButton>

    }
    else if (Model.State == EditState.Preview)
    {
    <MButton Text Block Color="primary" OnClick="OnNav">
            <MIcon Left>mdi-cube-scan </MIcon>
            @("预览"+Model.Title)
        </MButton>

    }
    else if (Model.State == EditState.Locked)
    {
    <MButton Text Block Color="primary">
            <MIcon Left>mdi-lock </MIcon>
            @(Model.Title+"被锁定")
        </MButton>

    }

@code {
    [Parameter]
    public EditButtonLineModel Model { get; set; }


    public void OnNav()
    {
        NavigationManager.NavigateTo(Model.Link);
        
    }
}
